//Header file for a Groovey particle set class

#ifndef G_P_SET
#define G_P_SET

#include <list>
#include "gparticle.hpp"
#include "gtransformer.hpp" ////autobots! Assemble!
#include <boost/random.hpp>

class GParticle_Set{
	public:
		GParticle_Set();
		GParticle_Set(const int Amount, const GParticle &GPart);
		
		///pre: for addparticles, GPart must be initiallized fully and well defined. Does not need to be alive.
		void addParticles(const int Amount, const GParticle &GPart); ///result: creates set of duplicates with 
																	 ///////size 'Amount'. If set is already 
																	 ///////defined, then the current set is 
																	 ///////lost in place of the newly created 
																	 ///////one. The given particle becomes the 
																	 ///////base, and is used for when the set 
																	 ///////needs to create a new particle.
		///pre: manipulation requires that there are particles in the set
		void manipParticles(const GTransformer& Transform);
		
		///pre: drawing requires that we have particles to draw with valid locations
		void drawParticles();										 ///result: Particles will be drawn
		
		///pre: updating a set requires that we have particles that require updating
		void UpdateSet(const int limit_X, const int limit_Y); 		 ///result: housecleaning. Particles are 
																	 ///////killed, or lives lost. Dead 
																	 ///////particles replaced. Manipulations 
																	 ///////are finalized (ie. location updated)
																	 
		bool howWeRollin();											 ///result: Return true if set is filled
		
	//////
	//////Privates:
	//////
	private:
		std::list<GParticle> p_set;
		GParticle base;
		int count;
		
		///RNG stuff... this will actually need some work, because we want to eventually make the
		//////particle location generator function pluggable... perhaps a template like GParticle_set<Position_Functor>
		
		boost::mt19937 rng;
		boost::uniform_int<> spread_X;
		boost::uniform_int<> spread_Y;
		/*////Later we will add mass. For now, keep it simple!
		boost::uniform_real<> masses(WEIGHT_CENTER - WEIGHT_VARIANCE, WEIGHT_CENTER + WEIGHT_VARIANCE);
		boost::variate_generator<boost::mt19937&, boost::uniform_real<> > dice_mass(rng, masses);
		*/
		boost::variate_generator<boost::mt19937&, boost::uniform_int<> > dice_X;
		boost::variate_generator<boost::mt19937&, boost::uniform_int<> > dice_Y;
		
};

#endif
